package com.bookyourtrek.action;

import java.util.Map;

import com.bookyourtrek.util.RuntimeSettings;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class AdminLoginAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String email;
	private String password;

	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public String adminlogin() {
		Map sess=ActionContext.getContext().getSession();
		
		if(email.equals(RuntimeSettings.ADMINUSEREMAIL) && 
				password.equals(RuntimeSettings.ADMINUSERPASSWORD)){
			sess.put("adminlogin", true);
			return SUCCESS;
			
		}
		return INPUT;
	}
}
